﻿using System;
using SimpleWorkflow.Steps;

namespace SimpleWorkflow.Patterns
{
    public class SimpleSegment : Segment
    {
        public Type StepType { get; private set; }

        public SimpleSegment(Type type)
        {
            if (type == null)
                throw new ArgumentException("Step type was null.");

            if (typeof(SimpleStep<>).IsAssignableFrom(type))
                throw new Exception("Segment not a valid step class: " + type.FullName);

            StepType = type;
        }
    }
}
